/*
 * hd44780-8.h
 * Public 8bit controller API
 *
 *  Created on: Sep 27, 2009
 *      Author: Orlando Arias
 *	   License: GPLv3
 *
 *   libhd44780 for Arduino systems
 *   Copyright (C) 2009  Orlando Arias
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef HD447808_H_
#define HD447808_H_

#include "common/common.h"

typedef struct _LCD8 {
	uint8_t datapin[8];
	uint8_t strobe;
	uint8_t rw_pin;
	uint8_t rs_pin;
} LCD8;

void lcd8_clear(LCD8 *l);			// same as lcd8_sendCommand(l, CLEAR)
uint8_t lcd8_getAC(LCD8 *l);		// returns address counter
uint8_t lcd8_getDDRAM(LCD8 *l);		// returns DDRAM data
uint8_t lcd8_getState(LCD8 *l);		// returns busy flag status
void lcd8_init(LCD8 *l);			// initializes LCD
void lcd8_sendChar(LCD8 *l, uint8_t chr);		// sends character to LCD
void lcd8_sendCommand(LCD8 *l, command cmd);	// sends command to LCD
void lcd8_sendStr(LCD8 *l, const char str[]);	// sends string to LCD
void lcd8_setAC(LCD8 *l, uint8_t row, uint8_t col);		// sets AC, same as lcd8_sendCommand(l, SET_POSITION + locationOffset)
void lcd8_writeCGRAM(LCD8 *l, uint8_t location, uint8_t data[]);	// stores a character in CGRAM

#endif /* HD447808_H_ */
